package utils

func NewPageRequest() *PageRequest {
	return &PageRequest{
		PageSize:   20,
		PageNumber: 1,
	}
}

type PageRequest struct {
	// 分页大小
	PageSize uint `json:"page_size" form:"page_size"`
	// 当前是多少页面
	PageNumber uint `json:"page_number" form:"page_number"`
}

func (r *PageRequest) Offset() uint {
	return ((r.PageNumber) - 1) * (r.PageSize)
}
